package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.ShowBean;
import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface TravelMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Travel record);

    Travel selectByPrimaryKey(Long id);

    List<Travel> selectAll();

    int updateByPrimaryKey(Travel record);

    List<Travel> queryForList(QueryObject qo);

    void changeState(Travel travel);

    List<Travel> selectTravelsBystrategyId(Long strategyId);

    void deleteRelation(@Param("strategyId") Long strategyId, @Param("travelId") Long travelId);

    List<Travel> getRegionTravelByStrategyId(Long strategyId);

    void saveRelation(@Param("strategyId") Long strategyId, @Param("travelId") Long travelId);
    /**
     * 查询关注用户List的分享List
     *
     * @param followList 关注用户集合
     * @return 分享数据集合
     */
    List<ShowBean> selectTravelShowBeanByUserIds(List<User> followList);


    Map<String,Object> selectTravelAndStatus(@Param("userId") Long userId, @Param("travelId") Long travelId);

    List<Travel> selectTravelsByUserId(@Param("userId") Long userId);
}